Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve input processing for StatsModelsLinearRegression #599

Merged
merged 3 commits into from
Apr 6, 2022

Conversation

fverac
Copy link
Collaborator

@fverac fverac commented Apr 4, 2022

No description provided.

@fverac fverac requested a review from kbattocchi April 4, 2022 19:39
Copy link
Collaborator

@kbattocchi kbattocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but please add a test (you can probably just take the repro in #185 and just verify that the point estimates are the same to within a small tolerance for both the sklearn LinearRegression model and ours).

@@ -514,7 +514,7 @@ def check_inputs(Y, T, X, W=None, multi_output_T=True, multi_output_Y=True):
return Y, T, X, W


def check_input_arrays(*args, validate_len=True, force_all_finite=True):
def check_input_arrays(*args, validate_len=True, force_all_finite=True, dtype=None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good way to address the issue.

Copy link
Collaborator

@kbattocchi kbattocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'll rebase on top of main once the test stability fixes are in.

@kbattocchi kbattocchi force-pushed the fverac/ImproveStatsModelsInputChecking branch from 401cf37 to 3d4c29a Compare April 6, 2022 15:28
@kbattocchi kbattocchi marked this pull request as ready for review April 6, 2022 19:50
@kbattocchi kbattocchi merged commit 493f7cd into main Apr 6, 2022
@kbattocchi kbattocchi deleted the fverac/ImproveStatsModelsInputChecking branch April 6, 2022 19:51
@fverac fverac linked an issue Apr 12, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StatsModelsLinearRegression needs check_input
2 participants